package fr.snac.serialization;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

public class Infos implements Serializable{

	private static final long serialVersionUID = 2847044167470086872L;

	private Map<String, PostInfo> map;
	
	public Infos(){
		this.map = new HashMap<String, PostInfo>();
	}
	
	public void put(String date, PostInfo postInfo){
		map.put(date, postInfo);
	}
	
	public boolean containsKey(String date){
		return map.containsKey(date);
	}
	
	public PostInfo get(String date){
		
		if (map.containsKey(date))
			return map.get(date);
		return null;
	}
	
	public boolean isPostImageDownloaded(String date){		
		if (map.containsKey(date))
			return map.get(date).isDownloaded();
		return false;
	}
	
	public int size(){
		return map.size();
	}
}
